<?php 
$cs=Yii::app()->clientScript;
$cssUrl= Yii::app()->request->baseUrl."/css/";
$jsUrl = Yii::app()->request->baseUrl."/js/";
$cs->registerCssFile($cssUrl."ad_list.css");
$cs->registerCssFile($cssUrl."ad_cover_list.css");
?>
<div id="main-col-small" class="div">
	<div class="mainColInner coverContainer">
		<h4><?=Yii::t('copy', 'list_ads')?></h4>
		<div id="page-container" class="mg-t-20">
			<?php for($i=0;$i<count($ads);$i++){
				$ad_url = $this->createUrl('copy/ad',array(ad_id=>$ads[$i]->id));
				?>
				<div class="adCoverListItem float-left mg-r-20">
					<?php $this->widget('AdImage',array('image'=>$ads[$i]->details->image,'url'=>$ad_url));
					echo CHtml::link($ads[$i]->details->title,$ad_url,array('class'=>'title'));
					$this->widget('AdSlogan',array('ad_id'=>$ads[$i]->id));
					$this->widget('AdSpentGraph');
					$cpuvClass = $ads[$i]->status == Ad::STATUS_ACTIVE?'cpuv':'cpuv soldout';
					echo CHtml::link($ads[$i]->details->cpuv,$ad_url,array('class'=>$cpuvClass));
					?>
				</div>				
			<?php }?>
		</div>
	</div>
</div>
<div id="side-col">
	<?php if(Yii::app()->user->isGuest) {
		$this->widget('TagRegister');
	}else{
	
	}
	$this->widget('CopyPub');?>
</div>